<?php
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
?>

<script type="text/javascript">
//必填项检测
$(document).ready(function(){
//	$(".oksubmit").click(function(){
//		var CompanymanageName = $("#CompanymanageName").val();
//		var CompanymanageEndTime = $("#CompanymanageEndTime").val();
//		if(CompanymanageName == ""){
//			alert("合同名称不能为空");
//		} else if(CompanymanageEndTime == ""){
//			alert("结束时间不能为空");
//		} else {
//			$("#f1").submit();
//		}
//	});
		 $.validator.setDefaults({ 
			 submitHandler: function(form) {
        
			  form.submit();    
			}       
		});
		 
		// validate signup form on keyup and submit
		$("#f1").validate({
			rules: {
			"data[Companymanage][name]": {
			required: true,string:true,stringMinLength:0,stringMaxLength:100
			},
			"data[Companymanage][signatory]": {
					required: false,formatOfName:true,stringMinLength:0,stringMaxLength:100
				},
			"data[Companymanage][startTimes]":{
					required: false,dateISO:true
				},	
			"data[Companymanage][endTime]":{
					required: true, dateISO:true
				}
			},
			messages: {
			},
			//设置验证触发事件 
			focusInvalid: false, 
			onkeyup: false, 
			//设置错误信息提示DOM  
			errorPlacement: function(error, element) { 
			error.appendTo( element.parent()); 
			}
		});
	});		
	$(function()
			{
				$("#deletefile").click(function(){
					file = $("#ff");   
					file.after(file.clone());   
					file.remove(); 
				});
			});
</script>
<script type="text/javascript">
	$(function(){
		$(".datepickerSpan :input").datepicker({
			inline: true
		});
		 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
		 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
		 
	});
</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Customer Managements');//一级目录
										   echo '>';echo __('Customer Managements');//二级目录
										   echo '>';echo __('contractmanagementlist');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('addcontractmanagement',true).'&nbsp;&nbsp;&nbsp;'.$thedetail['Companymanage']['name']);//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<div class="tabflex">

<?php echo $form->create('Companymanage',array('action'=>'addcontractmanagement','type'=> 'post','enctype'=>'multipart/form-data','id'=>'f1'));?>
<fieldset><legend><?php echo __('addcontractmanagement')?></legend>
<legend><?php echo __('contractmanagementlist information')?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
		<tr>
			<td></td>
			<td><?php echo __('contractmanagementlist Name');//合同名称?>:<font color="red">*</font></td>
			<td colspan="4">
			<?php 
				echo $form->input('name',array('label'=>false,'class' => 'TextBoxE1'));		
			?>
			</td>
		</tr>
		<tr>
		<td width="5%"></td>
		<td width="10%"><?php echo __('contractmanagementlist signatory');//签约人?>:</td>
		<td width="30%">
		<?php 
			echo $form->input('signatory',array('label'=>false,'class' => 'TextBoxE1'));		
		?>
		</td>
		<td width="5%"></td>
		<td width="10%"><?php echo __('contractmanagementlist datesigned');//签约时间?>:</td>
		<td>
		<span class="datepickerSpan">
		<?php 
			echo $form->input('datesigned',array('label'=>false,'class' => 'TextBoxE1'));	
		?>
		</span>
		</td>
		</tr>
		<tr>
		<td></td>
		<td><?php echo __('contractmanagementlist Coat');//合同金额?>:</td>
		<td>
		<?php 
			echo $form->input('amount',array('label'=>false,'class' => 'TextBoxE1'));	
		?>
		</td>
		<td ></td>
		<td><?php echo __('contractmanagementlist paymentmethod');//付款方式?>:</td>  
		<td>
		<?php 
			echo $form->input('paymentmethod',array('options'=>$op2,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));			
		?>
		</td>
		</tr>
		
		<tr>
		<td></td>
		<td><?php echo __('StartUseTime');//开始时间?>:</td>
		<td>
		<span class="datepickerSpan">
		<?php 
			echo $form->input('startTime',array('label'=>false,'class' => 'TextBoxE1'));	
		?>
		</span>
		
		</td>
		<td></td>
		<td><?php echo __('EndUseTime');//结束时间?>:<font color="red">*</font></td>
		<td>
		<span class="datepickerSpan">
		<?php 
			echo $form->input('endTime',array('label'=>false,'class' => 'TextBoxE1'));	
		?>
		</span>
		</td>
		</tr>
		</table>
	</table>	
	<legend><?php echo __('contractmanagementlist remind')?></legend>
	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="5%"></td>
		<td width="10%"><?php echo __('Contractmanagement reminder');//提醒人?>:</td> 
		<td width="30%">
		<?php 
		echo $form->input('reminder',array('options'=>$op1,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));	
			//echo $form->input('reminder',array('label'=>false));
		?>
		</td>

		<td width="5%"></td>
		<td width="10%"><?php echo __('Schedule remindTime');//提醒时间?>:</td>
		<td>
		<span class="datepickerSpan">
		<?php 
			echo $form->input('warntime',array('label'=>false,'class' => 'TextBoxE1'));	
		?>
		</span>
		</td>
		</tr>
		<tr>
		<td></td>
		<td><?php echo __('Schedule remindBefore');//提前时间?>:</td> 
		<td>
		<?php 
			echo $form->input('warnbefore',array('label'=>false,'div'=>false,'class' => 'TextBoxE1'));	
			echo "&nbsp;天";
		?>
		</td>
		<td></td>
		<td><?php echo __('Schedule remindSpacing');//间隔时间:?>:</td>
		<td>
		<?php 
			echo $form->input('internaltime',array('label'=>false,'div'=>false,'class' => 'TextBoxE1'));	
			echo "&nbsp;分";
		?>
		</td>
		</tr>
		<tr>
		<td></td>
		<td style="vertical-align:top;"><?php echo __('Base information');//基本信息?>:</td>
		<td  colspan="4">
		<?php 
			echo $form->textarea('basicmessage',array('label'=>false,'class' => 'areaStyle'));
		?>
		</td>
		</tr>
		<tr>
		<td></td>
		<td style="vertical-align:top;"><?php echo __('memo');//备注?>:</td>
		<td  colspan="4">
		<?php 
			echo $form->textarea('memo',array('label'=>false,'class' => 'areaStyle'));
		?>
		</td>
		</tr>
		
		<tr>
		<!--合同附件-->
		<td></td>
		<td><?php echo __('contractmanagementlist Attachment');//合同附件?>:</td>
		<td colspan="3">
			<?php 	
				echo $form->file('Specification',array('label'=>false,'class' => 'TextBoxL txtOut','size'=>50,'name'=>'Specification','id'=>'ff'));
			?> 
		</td>
		<td><?php //echo $form->button('取消附件',array('class'=>'btn4','id'=>'deletefile'));?>
		</tr>
		<tr>
		<td colspan="2"></td>
		<td colspan="4"><font color="red">系统默认设置为一份合同附件；如您有多份附件，可在合同信息里继续追加附件！</font></td>
		</tr>
</table>
</fieldset>
	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">

	<tr>
		<td width="50x"></td>
				<td width="100x"><?php //echo $form->button('返回',array('type'=>'button','class'=>'backsubmit','onclick'=>'history.back(-1)'));?></td>  <!-- 返回上一级-->
		
		<td width="100x"><!--
			<a><?php echo $html->image('ok.gif', array('alt' =>  __('Add', true),'border'=>'0','onclick'=>'mycheck()'));?></a>
 					  __('Add', true) 增加 
 			-->
 			<?php echo $form->button('添加',array('type'=>'submit','class'=>'oksubmit'));?>
		</td>
		<td width="100x">
			<?php //echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>
			
 					<!--  __('Add', true) 增加 -->
		</td>
		

	</tr>
</table>
<?php echo $form->hidden('companymanage_id',array('default'=>$companyid));?>
<?php echo $form->end();?>
